﻿
CREATE PROCEDURE [dbo].[sp_UserProfile_GetByID]
	-- Add the parameters for the stored procedure here
	(
				@UserKey int,
				@Sys_OrganizationID int
	)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT OFF;

	SELECT	[UserKey],
			[UserFullName],
			[UserSex],
			[UserDateOfBirth],
			[UserAlternateEmailID],
			[UserContactNumber],
			[UserContactAddress],
			[Sys_DateOfCreation],
			[Sys_DateOfModification],
			[Sys_CreatedByID],
			[Sys_ModifiedByID],
			[Sys_DeleteType],
			[Sys_IsDeleted],
			[Sys_OrganizationID],
			[Sys_InitialPrimaryKeys],
			[Sys_WorkstationName]
	FROM	[UserProfile]
	WHERE 
		(		
			[UserKey] = @UserKey AND 
			[Sys_IsDeleted] = 0 AND 
			[Sys_OrganizationID] = @Sys_OrganizationID
		)
END
